package org.bspv.pharma.manager.impl;

import java.util.List;

import org.bspv.pharma.dao.StandardEquipmentDetailDAO;
import org.bspv.pharma.manager.StandardEquipmentDetailManager;
import org.bspv.pharma.model.Place;
import org.bspv.pharma.model.StandardEquipment;
import org.bspv.pharma.model.StandardEquipmentDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 
 * @author guillaume
 * 
 */
@Service(value = "standardEquipmentDetailManager")
public class StandardEquipmentDetailManagerImpl extends
		AbstractManagerImpl<StandardEquipmentDetail, Long> implements
		StandardEquipmentDetailManager {

	@Autowired
	public StandardEquipmentDetailManagerImpl(StandardEquipmentDetailDAO dao) {
		super(dao);
	}

	public List<StandardEquipmentDetail> findDetails(StandardEquipment stdEqu) {
		String[] empty = {};
		String[] keys = { "standardEquipment" };
		Object[] values = { stdEqu };
		return dao.findBy(keys, values, empty, empty);
	}

	public List<StandardEquipmentDetail> save(
			List<StandardEquipmentDetail> details) {
		return dao.save(details);
	}

	public List<StandardEquipmentDetail> findAllStandardEquipmentDetails(
			Place place) {
		return ((StandardEquipmentDetailDAO) dao)
				.findAllStandardEquipmentDetails(place);
	}

}
